package org.springframework.samples.mvc.basic.proizvodenPogon;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.samples.mvc.basic.business.AbstractBusinessService;
import org.springframework.samples.mvc.basic.business.Transformer;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.proba.annotations.GenericDAO;
import com.proba.annotations.ProizvodenPogonDAO;
import com.proba.annotations.pojo.ProizvodenPogon;

@Service
public class ProizvodenPogonBusinessServiceImpl extends AbstractBusinessService<ProizvodenPogon, ProizvodenPogonView> implements ProizvodenPogonBusinessService {

	@Autowired
	private ProizvodenPogonDAO dao;
	private Transformer<ProizvodenPogon, ProizvodenPogonView> transformer = new ProizvodenPogonTransformer();
	
	@Override
	protected GenericDAO<ProizvodenPogon, Long> getDao() {
		return dao;
	}

	@Override
	protected Transformer<ProizvodenPogon, ProizvodenPogonView> getTransformer() {
		return transformer;
	}

	@Override
	@Transactional
	public List<ProizvodenPogonView> findAll(int startIndex, int pageSize,
			ProizvodenPogonView queryInfo) {
		return transform(dao.findByFilterParams(startIndex, pageSize, queryInfo.getId(), queryInfo.getProizvodenPogon(), queryInfo.getTipProizvodenPogon()));
	}

}
